feat(spec-validator): enforce SPDX-License-Identifier header on spec files#514
Merged
Merged
Conversation
…files Adds check apache#8 to the spec-validator: every .md file that carries YAML frontmatter must include '<\!-- SPDX-License-Identifier: Apache-2.0' before the opening --- delimiter. Files without frontmatter (README, overview) are skipped silently — no change to their handling. Adds validate_spdx_header() in __init__.py, plumbs it into validate_file(), updates the module docstring, and adds TestValidateSpdxHeader (7 tests) in the test suite. All 64 tests pass. Also fixes run-workspace-check.sh: on Apple Silicon Macs where git is an x86_64 binary (Rosetta), pre-commit hooks spawn x86_64 Python that cannot load arm64-compiled extensions (mypy, cffi). The script now probes for this condition at runtime and falls back to arch -arm64 python3 for the mypy and pytest checks. Generated-by: Claude (Sonnet 4.6)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds check to the spec-validator: every .md file that carries YAML frontmatter must include '<!-- SPDX-License-Identifier: Apache-2.0' before the opening --- delimiter. Files without frontmatter (README, overview) are skipped silently — no change to their handling.
Adds validate_spdx_header() in init.py, plumbs it into validate_file(), updates the module docstring, and adds TestValidateSpdxHeader (7 tests) in the test suite. All 64 tests pass.
Also fixes run-workspace-check.sh: on Apple Silicon Macs where git is an x86_64 binary (Rosetta), pre-commit hooks spawn x86_64 Python that cannot load arm64-compiled extensions (mypy, cffi). The script now probes for this condition at runtime and falls back to arch -arm64 python3 for the mypy and pytest checks.
Type of change
.claude/skills/<name>/) — eval fixtures updated belowtools/<system>/*.md)tools/*/withpyproject.toml)docs/,README.md,CONTRIBUTING.md)projects/_template/)prek, workflows, validators)Test plan
prek run --all-filespassesuv run pytest/ruff check/mypypasses(
PYTHONPATH=tools/skill-evals/src python3 -m skill_evals.runner tools/skill-evals/evals/<skill>/)(a regression test for the bug fixed / the behaviour added — see CONTRIBUTING.md)